﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace vantai
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void thaoTácToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
        }

        private void xemLịchVậnChuyểnToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            XemLichVanChuyen xlvc = new XemLichVanChuyen();
            xlvc.ShowDialog();
        }

        private void đăngKýLịchVậnChuyểnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
        }

        private void hủyĐăngKýLịchĐiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NhanVienCapNhatHuyDangKy cnlich = new NhanVienCapNhatHuyDangKy();
            cnlich.ShowDialog();
            
            
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            timer1.Start();

            //this.timer1.Interval = 100;

            //label4.Text = DateTime.Now.Date.ToShortDateString();
            

            //label6.Text = DateTime.Now.Month.ToString();
            //label8.Text = DateTime.Now.Year.ToString();

            ttriplbNgay.Text = DateTime.Now.Date.ToShortDateString();
            ttriplbthongtinnhanvien.Text = Login.TenNV;
            if (Login.LoaiNV != 1)
            {
                //[note] Quan ly duoc phep xem lich di
                //btnxemlichvanchuyen.Enabled = false;
                //btnnvcapnhatlichdi.Enabled = false;
                button5.Enabled = false;
                button6.Enabled = false;
                quảnLýCậpNhậtLịchĐiToolStripMenuItem.Enabled = false;
                quảnLýLậpLịchĐiToolStripMenuItem.Enabled = false;

            }
            //else
            //{
               
            //}
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            ttriplbThoiGian.Text = DateTime.Now.Hour.ToString()+" : "+ DateTime.Now.Minute.ToString()+" : "+DateTime.Now.Second.ToString();
        }

        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            timer1.Stop();
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            XemLichVanChuyen xlvc = new XemLichVanChuyen();
            xlvc.ShowDialog();
        }

        private void button2_Click(object sender, EventArgs e)
        {
        }

        private void button3_Click(object sender, EventArgs e)
        {
            NhanVienCapNhatHuyDangKy nvcn = new NhanVienCapNhatHuyDangKy();
            nvcn.ShowDialog();
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            laplichdi a = new laplichdi();
            a.ShowDialog();

        }

        private void button6_Click(object sender, EventArgs e)
        {
            XemLichVanChuyen xlvc = new XemLichVanChuyen();
            xlvc.ShowDialog();
        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }

        private void quảnLýLậpLịchĐiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            laplichdi ll = new laplichdi();
            ll.ShowDialog();
        }

        private void quảnLýCậpNhậtLịchĐiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            XemLichVanChuyen xl = new XemLichVanChuyen();
            xl.ShowDialog();
        }

        private void MainForm_KeyUp(object sender, KeyEventArgs e)
        {
            //MessageBox.Show("hey");
        }
    }
}

